package com.boarsoft.boar.lib.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import com.boarsoft.bean.ReplyInfo;
import com.boarsoft.boar.entity.SoaNexus;
import com.boarsoft.boar.lib.LibBiz;
import com.boarsoft.common.dao.PagedResult;
import com.boarsoft.common.util.JsonUtil;

public class LibSoaAction {
	@Autowired
	private LibBiz libBiz;

	@RequestMapping("/listSoa.do")
	// @Authorized(code = "lib.soa.list")
	public ReplyInfo<String> listSoa(String id, int pageNo, int pageSize) {
		List<SoaNexus> list = libBiz.listOnMe(id);
		int total = list.size();
		PagedResult<SoaNexus> pr = new PagedResult<>(total, list, pageNo, pageSize);
		return new ReplyInfo<String>(true, JsonUtil.from(pr));
	}
}